package pen_exam.meiidi_0224_03_28;

import java.util.Scanner;

public class Class03_MInDis {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());
        double[][] arr = new double[N][2];
        String[] xs = sc.nextLine().split(" ");
        String[] ys = sc.nextLine().split(" ");
        for (int i = 0; i < N; i++) {
            arr[i][0] = Double.parseDouble(xs[i]);
            arr[i][1] = Double.parseDouble(ys[i]);
        }
        System.out.println(minDis(arr));
    }
    public static double minDis(double[][] arr){
        double ans = Double.MAX_VALUE;
        for(int i = 0;i < arr.length;i++){
            for(int j = i + 1;j < arr.length;j++){
                ans = Math.min(ans, Math.sqrt(
                        Math.pow(arr[i][0] - arr[j][0],2)   + Math.pow(arr[i][1] - arr[j][1],2)
                ));
            }
        }
        //ans 保留四位小数并 四舍五入
       ans =  Math.round(ans * 10000.0);
        ans =  ans / 10000.0;
        return ans;
    }
}
